/*
 * Copyright (c) gitee.com/jiandong001.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

//import { NativeModule } from './bridge/NativeModule';
//import { ReactContext } from './bridge/ReactContext';
//import { ReactPackage } from './ReactPackage';
//export abstract class TurboReactPackage implements ReactPackage {
//    public constructor() {}
//
//    public List<NativeModule> createNativeModules(reactContext: ReactContext) {
//        throw new Error("In case of TurboModules, createNativeModules is not supported. NativeModuleRegistry should instead use getModuleList or getModule method");
//    }
//
//    public abstract getModule(var1: string, var2: ReactContext): NativeModule
//
//    public Iterable<ModuleHolder> getNativeModuleIterator(final ReactApplicationContext reactContext) {
////        Set<Entry<String, ReactModuleInfo>> entrySet = this.getReactModuleInfoProvider().getReactModuleInfos().entrySet();
////        final Iterator<Entry<String, ReactModuleInfo>> entrySetIterator = entrySet.iterator();
////        return new Iterable<ModuleHolder>() {
////            @NonNull
////            public Iterator<ModuleHolder> iterator() {
////                return new Iterator<ModuleHolder>() {
////                    Entry<String, ReactModuleInfo> nextEntry = null;
////
////                    private void findNext() {
////                        while(true) {
////                            if (entrySetIterator.hasNext()) {
////                                Entry<String, ReactModuleInfo> entry = (Entry)entrySetIterator.next();
////                                ReactModuleInfo reactModuleInfo = (ReactModuleInfo)entry.getValue();
////                                if (ReactFeatureFlags.useTurboModules && reactModuleInfo.isTurboModule()) {
////                                    continue;
////                                }
////
////                                this.nextEntry = entry;
////                                return;
////                            }
////
////                            this.nextEntry = null;
////                            return;
////                        }
////                    }
////
////                    public boolean hasNext() {
////                        if (this.nextEntry == null) {
////                            this.findNext();
////                        }
////
////                        return this.nextEntry != null;
////                    }
////
////                    public ModuleHolder next() {
////                        if (this.nextEntry == null) {
////                            this.findNext();
////                        }
////
////                        if (this.nextEntry == null) {
////                            throw new NoSuchElementException("ModuleHolder not found");
////                        } else {
////                            Entry<String, ReactModuleInfo> entry = this.nextEntry;
////                            this.findNext();
////                            String name = (String)entry.getKey();
////                            ReactModuleInfo reactModuleInfo = (ReactModuleInfo)entry.getValue();
////                            return new ModuleHolder(reactModuleInfo, TurboReactPackage.this.new ModuleHolderProvider(name, reactContext));
////                        }
////                    }
////
////                    public void remove() {
////                        throw new UnsupportedOperationException("Cannot remove native modules from the list");
////                    }
////                };
////            }
////        };
//    }
//
//    protected getViewManagers(reactContext: ReactContext): List<ModuleSpec>  {
//        return Collections.emptyList();
//    }
//
//    public createViewManagers(reactContext: ReactContext): List<ViewManager> {
////        List<ModuleSpec> viewManagerModuleSpecs = this.getViewManagers(reactContext);
////        if (viewManagerModuleSpecs != null && !viewManagerModuleSpecs.isEmpty()) {
////            List<ViewManager> viewManagers = new ArrayList();
////            Iterator var4 = viewManagerModuleSpecs.iterator();
////
////            while(var4.hasNext()) {
////                ModuleSpec moduleSpec = (ModuleSpec)var4.next();
////                viewManagers.add((ViewManager)moduleSpec.getProvider().get());
////            }
////
////            return viewManagers;
////        } else {
////            return Collections.emptyList();
////        }
//    }
//
//    public abstract getReactModuleInfoProvider(): ReactModuleInfoProvider;
//}
//
//private class ModuleHolderProvider implements Provider<NativeModule> {
//    private mName: string;
//    private mReactContext: ReactContext;
//
//    public ModuleHolderProvider(name: string, reactContext: ReactContext) {
//        this.mName = name;
//        this.mReactContext = reactContext;
//    }
//
//    public get(): NativeModule {
//        return TurboReactPackage.this.getModule(this.mName, this.mReactContext);
//    }
//}
